]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
brightnessManager: Handle absence of brightness control in _sync
authorSebastian Wick <sebastian.wick@redhat.com>
Mon, 8 Sep 2025 11:19:21 +0000 (13:19 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 10 Sep 2025 08:28:57 +0000 (08:28 +0000)
We already call _sync in response to dimming changes, which might happen
no matter if we actually do have control over the brightness.

Let's just embrace _sync getting called in any situation and handle that
state gracefully by simply returning early. If we re-gain control, _sync
will be called again and the updated state becomes active.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8648
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3864>

js/misc/brightnessManager.js

index 23cd147d730eea0339ca67a69569f945745e24e9..71f9037637a44c4fef113467181d0ddf36bd47f8 100644 (file)
@@ -175,13 +175,14 @@ export const BrightnessManager = GObject.registerClass({
             });
         }
 
-        if (this._globalScale)
-            this._sync({showOSD: false});
+        this._sync({showOSD: false});
 
         this.emit('changed');
     }
 
     _sync({showOSD = true} = {}) {
+        if (!this._globalScale)
+            return;
         if (this._inhibitUpdates)
             return;
         this._inhibitUpdates = true;